<!--
 * @Description: 折叠组件
 * @Author: kcz
 * @Date: 2020-01-13 00:37:54
 * @LastEditors: kcz
 * @LastEditTime: 2020-03-28 11:32:39
 -->
<template>
    <ul>
    <li
      v-for="(val, index) in items"
      :key="index"
      @dragstart="$emit('generateKey',$event, items, index)"
      @click="$emit('handleListPush', val)"
	  :id="val.type"
	  :data-img="val.img"
	  draggable = true
    >
      <svg v-if="val.icon" class="icon" aria-hidden="true">
        <use :xlink:href="`#${val.icon}`"></use>
      </svg>
      {{ val.label }}
    </li>
	</ul>
</template>
<script>
//import draggable from "vuedraggable";
export default {
  name: "collapseItem",
  props: ["list"],
  //components: {
   // draggable
  //},
  data(){
	return{
	   items:this.list
	}
  },
  methods: {
    handleStart(e, list) {
	  e.preventDefault();
      this.$emit("start", list[e.oldIndex].type);
    },
	getId(item){
	  debugger;
	  return item.id
	}
  }
};
</script>
